<?php
class Readcsvlogin_m extends CI_Model{
    function __construct() {
        parent::__construct();
    }
    public function readCSVLogin($patchFile)
    {
        $i=0;
        $handle = fopen($patchFile, 'r');
        while ($array_val= fgetcsv($handle))
        {
           
            if($array_val[0]=="Testees")
            {
             $i++;
             $testees[] = $array_val[3];
             $name[] = $array_val[4];
             $mail[] = $array_val[5];
             $id[] = $array_val[7];
             $pw[] = $array_val[9];
            }
            if($array_val[0]=="#") break;   
        }
        $readLogin=Array('testees'=>$testees,
                         'name'=>$name,
                         'mail'=>$mail,
                         'id'=>$id,
                         'pw'=>$pw,
                         'i'=>$i   );
        return $readLogin;
        fclose($handle);
}       
}
?>
